package com.nl.gen.config;

/**
 * 请求线程.
 *
 * @author zenghao
 */
public class RequestThread {

    private static final ThreadLocal<GenerateConfig> THREAD_LOCAL = new InheritableThreadLocal<>();

    /**
     * clean.
     */
    public static void clean() {
        THREAD_LOCAL.remove();
    }

    /**
     * getConfig.
     *
     * @return GenerateConfig
     */
    public static GenerateConfig getConfig() {
        return THREAD_LOCAL.get();
    }

    /**
     * setConfig.
     *
     * @param config config
     */
    public static void setConfig(final GenerateConfig config) {
        THREAD_LOCAL.set(config);
    }
}
